<?php
//include the functions.php
require "include/functions.php";

/*
	Generates the quiry data for current stock level
	Created by		 : Lee
	Created On		 : 29.August.2011
	Last Modification: created document
	Modified On		 : 29.August.2011
	Modified By		 : Lee
*/
check_session();
//Check the user to be an administrator
check_admin();

//Define Data Variables
$InnerMenu='';

if(!filter_has_var(INPUT_POST, "InnerMenu")){}
else
{
	$InnerMenu	= $_REQUEST["InnerMenu"];
}
?>

<html>
<head>
<title>Home Electronics - Product Listiing</title>
<link rel="stylesheet" href="include/styles.css" type="text/css">
<script src="include/jquery-1.6.2.min.js"></script>
</head>
<script>

//Control the Inner Menu
function ShowField(value)
{
		if (value=='ProductsList') 
	{
			if (document.Data.InnerMenu.value!='')
			{
				 $('#stocklvl').hide('fast');
			}
		
			if (document.Data.InnerMenu.value!='ProductsList')
			{		
				$('#prodlist').show('slow');
				document.Data.InnerMenu.value='ProductsList';
			}
	}

	else if (value=='StockLvl')  
	{
		
			if (document.Data.InnerMenu.value!='') 
			{
				$('#prodlist').hide('fast');
			}
			
			if (document.Data.InnerMenu.value!='StockLvl')
			{
				$('#stocklvl').show('slow');
				document.Data.InnerMenu.value='StockLvl';
			}
	}
	
	
}
</script>

<body>
<div id="container" align="center">
   <div id="header">
		<div id="topmenu"><ul><?php top_menu(); ?></ul></div> 
		<div id="menu" align="right">
		<form name="form1" method="post" action="search.php">
		<tr>
		<td height="35" width="78"><a>Search Products</a></td>
		<td height="35" width="3"></td>
		<td height="35" width="294"><input name="mysearch" type="text" id="mysearch">&nbsp;&nbsp;&nbsp;</td>
		</tr>
		</form>
		</div>
		<div id="menubar"> <!-- Menu buttons -->
  		<ul>
   		<li><a href="index.php" title="Home"><span>Home</span></a></li>
	    <li><a href="#" title="Computing"><span>Computing</span></a></li>
		<li><a href="#" title="Kitchen"><span>Kitchen</span></a></li>
		<li><a href="#" title="Bathroom"><span>Bathroom</span></a></li>
		<li><a href="#" title="Laundry"><span>Laundry</span></a></li>
		<li><a href="#" title="Furniture and Bedding"><span>Furniture & Bedding</span></a></li>
    	</ul>
		</div>
	</div> <!-- Header -->

	<div align="center">
		<div id="page">
            <form name="Data" action="" method="post">
            <input type="hidden" name="InnerMenu" value="<?=$InnerMenu?>" />
           <table class="iframestyle">
				<tr>			
					<td height='15%' align='center'>
                    <h5>Please Select a Report</h5> 
						<input type="button" id="btnProdList" class="newbutton"  value="Product List" onClick="Javascript:ShowField('ProductsList');">
                        <input type="button" id="btnStockLvl" class="newbutton"  value="Stock Level" onClick="Javascript:ShowField('StockLvl');">
                        
                        <input type="button" id="btnBack" class="newbutton" value="Back" onClick="Javascript:window.location = 'admin_login.php';">
                    </td>
				</tr>
                <tr>
					<td>
					<div height="100%" width="100%" id='prodlist'>
                     		            
                       <iframe class="iframestyle" SRC="product_listing.php">
					   </iframe>
                        
            		
						                  
                        
                        
		          </div>
                     </td>  
                  </tr>
                   <tr>
                    <td>  
                      <div id='stocklvl' height="100%" width="100%">
                      	 <iframe class="iframestyle" SRC="stock_level.php">
					   </iframe>
						</div>
					</td>			
				</tr>					
			</table>
            </form>
           
		</div>  
	</div> <!--body div -->
   		
   <? footer(); ?>
</div>
</body>
<script>
if (document.Data.InnerMenu.value =="")
{
	$('#prodlist').hide(1);
	$('#stocklvl').hide(1);
}
else{
	ShowField(document.Data.InnerMenu.value);
}
</script>
</html>